Skip to content

chore: set the number of threads to the number of cores by default#148

Merged
matthias-wright merged 2 commits intomainfrom
m/worker-threads
Mar 23, 2026
Merged

chore: set the number of threads to the number of cores by default#148
matthias-wright merged 2 commits intomainfrom
m/worker-threads

Conversation

@matthias-wright
Copy link
Collaborator

This makes the --worker_threads CLI argument default to None. If no argument is passed, then the tokio runtime will use as many threads as there are cores. The number of cores is obtained via std::thread::available_parallelism().

According to the docs, available_parallelism can return an error, for example if the amount of parallelism is not known to the target platform, or the program lacks permission to query the amount of parallelism.
This should never happen, but in this case the number of threads will default to 4.

@matthias-wright matthias-wright merged commit 78e415f into main Mar 23, 2026
4 checks passed
@matthias-wright matthias-wright deleted the m/worker-threads branch March 23, 2026 18:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant